Skip to content

Conversation

@geegong
Copy link
Contributor

@geegong geegong commented Jan 24, 2026

답안 제출 문제

작성자 체크 리스트

  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

검토자 체크 리스트

Important

본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!

  • 바로 이전에 올라온 PR에 본인을 코드 리뷰어로 추가해주세요.
  • 본인이 검토해야하는 PR의 답안 코드에 피드백을 주세요.
  • 토요일 전까지 PR을 병합할 수 있도록 승인해주세요.

@geegong
Copy link
Contributor Author

geegong commented Jan 24, 2026

@DaleStudy 리뷰해줘

@dalestudy
Copy link
Contributor

dalestudy bot commented Jan 24, 2026

이 PR은 여러 문제에 대한 깔끔한 솔루션을 제시했고, 각각의 코드도 가독성이 좋으며 구조화가 잘 되어 있습니다. 특히, 그래프 위상 정렬, 문자열 검색, 최적화된 수열 문제 등 다양한 알고리즘을 잘 적용하셨네요. 다음은 몇 가지 개선 및 격려 포인트입니다:

  1. 시간/공간 복잡도 표기 요청: 각 문제의 주석에 TC, SC를 명확히 표기하면 더 완성도 높은 문서화가 될 것 같습니다. 예를 들어, canFinishTC: O(V + E), SC: O(V + E) 정도로 표기 가능합니다.

  2. 코드 가독성: 변수명, 주석 모두 직관적입니다. 다만, queue.iterator().hasNext() 대신 !queue.isEmpty()를 사용하는 것이 더 명확하고 권장됩니다.

  3. 알고리즘 개선 제안:

    • canFinish에서, queue.iterator().hasNext() 대신 !queue.isEmpty()를 사용하세요. 이는 명확성과 성능 면에서 더 적합합니다.
    • merge 함수에서 result에 새 구간을 add() 후, remove() 후 다시 add()하는 대신에, result의 마지막 구간을 업데이트하는 방식으로 변경하면 더 깔끔할 수 있습니다.
  4. 코드 스타일:

    • setNext 메서드에서 next[ch - 'a'] = new Node();를 바로 하는 것도 좋겠고, null 체크도 깔끔합니다.
    • for 루프 내부에서 변수 선언과 할당을 조금 더 일관되게 정리하면 좋겠습니다.
  5. 학습 포인트:

    • 그래프 문제는 위상 정렬 개념이 아주 잘 드러나 있으며, 이진 연산을 활용한 최대 곱셈 문제는 Kadane의 알고리즘을 확장한 좋은 예입니다.
    • 문자열 검색에서 DFS와 backtracking을 적극 활용하셨고, . 와 같은 와일드카드 처리도 깔끔하게 구현하셨네요.

전반적으로 코드 품질이 높고, 다양한 알고리즘을 잘 활용하셨습니다. 앞으로도 이렇게 구조화된 문제 해결 방식을 계속 유지하고, 주석과 복잡도 표기를 통해 문서화도 신경 쓰시면 더욱 훌륭한 리포지토리 될 것 같습니다. 고생 많으셨고, 계속해서 좋은 문제 풀이 기대하겠습니다!

@DaleSeo DaleSeo self-requested a review January 24, 2026 12:11
Copy link
Member

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다! 코멘트 몇 개 남겼습니다. PR 설명에는 1문제 푸셨다고 하셨는데 실제로는 4문제 푸신 것 같네요. 업데이트해주시면 좋을 것 같습니다.

public boolean canFinish(int numCourses, int[][] prerequisites) {

int[] indegreeCnt = new int[numCourses];
Arrays.fill(indegreeCnt, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정수 배열은 기본값은 0이니 불필요한 줄인 것 같습니다.



int currentTakenCnt = 0;
while(queue.iterator().hasNext()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 AI 코치의 의견에 동의하는 바입니다.

Suggested change
while(queue.iterator().hasNext()) {
while(!queue.isEmpty()) {

Comment on lines 54 to 55
for (int idx=0; idx<targets.size(); idx++) {
int course = targets.get(idx);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요렇게 for 루프를 작성하셨으면 더 깔끔했을 것 같다는 생각이 들었습니다.

Suggested change
for (int idx=0; idx<targets.size(); idx++) {
int course = targets.get(idx);
for (int course : targets) {


public class Geegong {

/**
* case 1. Letter 라는 클래스 안에 각 char 를 가지고 있고 하나씩 순회하면서 search 를 하니 응답속도가 너무 느림..
* 이전 기수와는 다르게 배열을 활용해서 문제 풀이
* time complexity : O(N^2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

시간 복잡도 분석이 정확한지 다시 한 번 확인해보시면 좋을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

꼼꼼한 리뷰 감사드립니다 👍
그런데 저.. 궁금한것이 시간복잡도가 O(26^N) 이라고 하는게 맞는지 사실 잘 확신이 안듭니다 ㅎㅎ
"." 이 있을때마다 26개 문자열에 대해서 계속 뻗어나가니 맞을것 같긴한데..🤔 코딩 테스트에서의 시간 복잡도를 최적의 케이스와 최악의 케이스로 나눠서 얘기해도 되는지 궁금하긴 하네요ㅎㅎ;

int[] last = result.get(result.size() - 1);
int[] newThing = new int[]{last[0], Math.max(last[1], current[1])} ;
result.remove(result.size() - 1);
result.add(result.size() - 1, newThing);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 리트코드에 제출해보셨나요? 이 부분에서 제거 후 리스트가 비었을 경우 -1 인덱스가 되어 오류가 발생할 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 이런;; 해당 코드를 처음에 작성했던 코드고 오류가 있어서 리트코드에서 다시 풀었는데 해당 파일에는 업데이트를 하지 않았네요ㅠㅠ 예리한 지적 감사합니다 🙏

@geegong geegong merged commit f2f5047 into DaleStudy:main Jan 24, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from In Review to Completed in 리트코드 스터디 6기 Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants